<?php

include '../../config/standard/config.php';

function mySQLConnect($host,$user,$pass,$db)
{
	

}
function closeMySQLConnect()
{
	
}
function checkSQL()
{
 	echo'DB_HOST:'.$db_host.'<br/>DB_USER:'.$db_user.'<br/>DB_PASS: '.$db_pass;
	//return 
}

function loginUser($username,$password,$host,$user,$pass,$db)
{
	
	$con = mysql_connect($host,$user,$pass);
	if(!$con)
	{
		die('Could not connect: '. mysql_error());
	}

	mysql_selectdb($db, $con); 
	
	mySQLConnect($host,$user,$pass,$db);

	$result = mysql_query("SELECT 1 as login FROM user WHERE name = '$username' and pass = '$password' ");
	
	while($row = mysql_fetch_array($result))
	{		
		$login = $row['login'];
	}
	if($login == null);
	{
	 $login = 0;
	}
		
	mysql_close($con);
	return $login;
		
}
 
?>